{% extends "base.html" %}
{% block title %}
    xlsx 文件上传
{% endblock %}

{% block content %}
    <div>
    <form method="post"  enctype="multipart/form-data" action={% url "uploadxlsxurl" %}>
        {% csrf_token %}
        {{ uf.as_p }}
        <button type="submit" class="btn btn-success btn-sm">上传</button>
    </form>
    </div>
    <hr/>
    <table class="result-tab" width="100%">
        <tr>
            <th class="tc" width="5%"></th>
            <th>ID</th>
            <th>日期</th>
            <th>文件</th>
            <th>操作</th>
        </tr>
        {% for foo in lpage %}
        <tr>
            <td class="tc">
                <input type="checkbox" value="" name="id[]">
            </td>
            <td>{{ foo.id }}</td>
            <td>{{ foo.date }}</td>
            <td>{{ foo.filename }}</td>
            <td class="host_buttom">
                <a class="btn btn-warning btn-xs" href={% url "writedataurl" foo.id %} onclick="return confirm('是否确认导入数据库？')">导入</a>
                <a class="btn btn-danger btn-xs" href={% url "delxlsxurl" foo.id %} onclick="return confirm('是否确认删除？')">删除</a>
            </td>
        </tr>
        {% endfor %}
    </table>
    {% include "paginator.html" %}
{% endblock %}